package com.gin.kotlin.no_gay_alliance.adapter.replyhistory

import android.content.Context
import com.gin.kotlin.no_gay_alliance.base.AbstractBindingRecyclerViewAdapter
import com.gin.kotlin.no_gay_alliance.base.MyHandler
import com.gin.kotlin.no_gay_alliance.database.entity.ReplyHistoryTaskLog
import com.gin.kotlin.no_gay_alliance.databinding.ItemReplyHistoryTaskLogBinding
import com.gin.kotlin.no_gay_alliance.utils.TimeUtils

class ReplyHistoryTaskLogAdapter(context: Context, handler: MyHandler) : AbstractBindingRecyclerViewAdapter<ItemReplyHistoryTaskLogBinding, ReplyHistoryTaskLog>(context, handler) {
    override fun onBindViewHolder(holder: ViewHolder<ItemReplyHistoryTaskLogBinding>, position: Int, b: ItemReplyHistoryTaskLogBinding, dataModel: ReplyHistoryTaskLog) {
        b.tvMessage.text = dataModel.message
        b.tvCode.text = dataModel.code.toString()
        b.tvTimestamp.text = TimeUtils.FULL_DATE_TIME_FORMATTER.format(dataModel.timestamp)
    }
}